package grape.wx.rest.client.impl.user;

import grape.wx.rest.client.user.MpUserClient;
import grape.wx.rest.mp.basic.mvc.MpOAuth2InnerController;
import grape.wx.rest.mp.user.mvc.MpUserInnerController;
import grape.wx.service.mp.user.api.IMpUserService;
import grape.wx.service.mp.user.po.MpUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created by yangwei
 * Created at 2020/7/28 19:06
 */
@Component
public class MpUserClientImpl implements MpUserClient {
    @Autowired
    private MpUserInnerController mpUserInnerController;
    @Autowired
    private MpOAuth2InnerController mpOAuth2InnerController;


    @Override
    public String trans(String type, String key) {
        return mpUserInnerController.trans(type,key);
    }

    @Override
    public boolean support(String type) {
        return mpUserInnerController.support(type);
    }

    @Override
    public MpUser getByOpenidAndAppCode(String openId, String appCode) {
        return mpUserInnerController.getByOpenidAndAppCode(openId,appCode);
    }

    @Override
    public MpUser getById(String id) {
        return mpUserInnerController.getById(id);
    }

    @Override
    public MpUser oauth2getUserInfo(String appId, String code) {
        return mpOAuth2InnerController.oauth2getUserInfo(appId,code);
    }
}
